package material.command.simpleRemote;

import material.command.receiver_命令接收者.GarageDoor;
import material.command.receiver_命令接收者.Light;

public class SimpleRemoteControlTest {
    public static void main(String[] args) {
//        /*遥控器就是一个调用者，会传入一个命令对象，可以用来发出请求*/
//        SimpleRemoteControl remote = new SimpleRemoteControl();
//        /*创建一个灯对象，此对象就是请求的接收者*/
//        Light light = new Light();
//        /*在这里创建一个命令，然后将接收者传给他*/
//        LightOnCommand lightOn = new LightOnCommand(light);
//        /*把命令传给调用者*/
//        remote.setCommand(lightOn);
//        /*按下模拟按钮*/
//        remote.buttonWasPressed();

//        SimpleRemoteControl remoteControl = new SimpleRemoteControl();
//        Light light = new Light();
//        GarageDoor garageDoor = new GarageDoor();
//        LightOnCommand lightOnCommand = new LightOnCommand(light);
//        GarageDoorOpenCommand garageDoorOpenCommand = new GarageDoorOpenCommand(garageDoor);
//        remoteControl.setCommand(lightOnCommand);
//        remoteControl.buttonWasPressed();
//        remoteControl.setCommand(garageDoorOpenCommand);
//        remoteControl.buttonWasPressed();

    }
}
